package com.yungu.swift.api.route.v1.common;


import com.alibaba.dubbo.config.annotation.Reference;
import com.yungu.swift.api.base.BaseApi;
import com.yungu.swift.base.ResponseData;
import com.yungu.swift.order.model.dto.OrderCallHistoryDto;
import com.yungu.swift.order.service.OrderJoinService;
import com.yungu.swift.order.service.OrderService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;

@Controller
@RequestMapping(value = "/notify")
@Api(value = "【公共】【跨城订单】消息通知相关接口", tags = "消息通知")
public class NotifyApi extends BaseApi {

    @Reference
    private OrderJoinService orderJoinService;

    @ApiOperation(value = "订单通知", notes = "来电通知")
    @RequestMapping(value = {"/order/join/call"}, method = {RequestMethod.POST, RequestMethod.GET})
    @ResponseBody
    public ResponseData<OrderCallHistoryDto> login(
            @ApiParam(name = "appid", value = "APP标识", required = true) @RequestParam String appid,
            @ApiParam(name = "phoneNumber", value = "来电号码", required = true) @RequestParam String phoneNumber) {
        return orderJoinService.recvJoinOrderCall(phoneNumber, appid);
    }
}
